<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui">
	  
<f:view locale="#{switcher.currentLocale}">	  

<h:head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">

</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">  
           .ui-widget {  
               font-size: 10px !important;  
           }  
</style>

<title>#{msg.pagamentos}</title>

	<ui:include src="/layout/Header.xhtml" />
</h:head>

<h:body>
<center>	
			<h4>#{msg.pagamentoConta}</h4>
			#{msg.preenchaPagamento}<br/>
	<br/>
	<h:form id="submit">
	
	
	<table>
	<tr>
		<td>
			#{msg.saldoDisp}:
		</td>
		<td>R$ <h:outputText value="#{cliente.contaCorrente.saldo}" >
				<f:convertNumber minFractionDigits="2" />
				</h:outputText>
		</td>
	</tr>
	<tr>
		<td>
			#{msg.barcode}:
		</td>
		<td>
			<h:inputText value="#{transacaoManagedBean.codBarras1}" validator="#{validator.verificador4Digitos}" 
						 id="bc1" size="3" maxlength="4" required="true"
						 requiredMessage="#{msg.primeiro}: #{msg.campoObrigatorio}"
						 validatorMessage="#{msg.primeiro}: #{msg.quatroDigitos}"
						 converterMessage="#{msg.barcode}: #{msg.valorInvalido}">
				<f:validateLongRange minimum="0"/>
			</h:inputText>
			
			<h:inputText value="#{transacaoManagedBean.codBarras2}" validator="#{validator.verificador4Digitos}" 
						 id="bc2" size="3" maxlength="4" required="true"
						 requiredMessage="#{msg.segundo}: #{msg.campoObrigatorio}"
						 validatorMessage="#{msg.segundo}: #{msg.quatroDigitos}"
						 converterMessage="#{msg.barcode}: #{msg.valorInvalido}">
				<f:validateLongRange minimum="0"/>
			</h:inputText>
			
			<h:inputText value="#{transacaoManagedBean.codBarras3}" validator="#{validator.verificador4Digitos}"
						 id="bc3" size="3" maxlength="4" required="true"
						 requiredMessage="#{msg.terceiro}: #{msg.campoObrigatorio}"
						 validatorMessage="#{msg.terceiro}: #{msg.quatroDigitos}"
						 converterMessage="#{msg.barcode}: #{msg.valorInvalido}">
				<f:validateLongRange minimum="0"/>
			</h:inputText>
			
			<h:inputText value="#{transacaoManagedBean.codBarras4}" validator="#{validator.verificador4Digitos}" 
						 id="bc4" size="3" maxlength="4" required="true"
						 requiredMessage="#{msg.quarto}: #{msg.campoObrigatorio}"
						 validatorMessage="#{msg.quarto}: #{msg.quatroDigitos}"
						 converterMessage="#{msg.barcode}: #{msg.valorInvalido}">
				<f:validateLongRange minimum="0"/>
			</h:inputText>
		</td>
	</tr>
	<tr>
		<td>
			#{msg.valorPagamento}:
		</td>
		<td>
			R$ <h:inputText id="valor" value="#{transacaoManagedBean.transacao.valor}" size="8" required="true" maxlength="9"
				requiredMessage="#{msg.valor}: #{msg.campoObrigatorio}"
				converterMessage="#{msg.valor}: #{msg.valorInvalido}" >
					<f:validateDoubleRange minimum="0.05" />
			</h:inputText>
			
		</td>
	</tr>
	<tr>
		<td valign="top">
			#{msg.descricao}:
		</td>
		<td>
			 <p:inputTextarea value="#{transacaoManagedBean.transacao.descricao}" rows="5" cols="30" counter="display" maxlength="50" counterTemplate="{0} #{msg.charRemain}" autoResize="false" />
   			 <br/><h:outputText id="display" />
		</td>
	</tr>
	</table>
	
	<p></p>
	<h:commandButton id="transferir" value="#{msg.transferir}" action="transacaoConfirm" >
		<f:setPropertyActionListener target="#{transacaoManagedBean.tipoTransacao}" value="Payment"></f:setPropertyActionListener>
	</h:commandButton>
	<br/>
			<h:message for="valor" style="color:red" /> <br/>
			<h:message for="bc1" style="color:red" /> <br/>
			<h:message for="bc2" style="color:red" /> <br/>
			<h:message for="bc3" style="color:red" /> <br/>
			<h:message for="bc4" style="color:red" /> <br/>
	
	</h:form>
	
</center>
</h:body>
</f:view>
</html>